package com.lw.smartdevice.mapper;

import com.lw.smartdevice.pojo.SysCategory;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Administrator
 * @version 1.0
 * @description:
 * @date 2022/3/20 19:15
 */
public interface SysCategoryMapper {

    @Insert("insert into sys_category (category_name,tx_command,rx_command,command_name,create_time,create_by) " +
            "values (#{categoryName},#{txCommand},#{rxCommand},#{commandName},#{createTime},#{createBy})")
    void addSysCategory(SysCategory sysCategory);
    
    @Select("select * from sys_category where c_id=#{id};")
    SysCategory findById(Long id);

    @Select("select * from sys_category")
    List<SysCategory> findAll();

    int updateCategory(SysCategory category);


    int deleteByIds(@Param("ids") List<Long> ids);
}
